home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(!_root.main.gonogo)
- {
- return undefined;
- }
- if(this._name != "person")
- {
- vely += a;
- x += velx;
- y += vely;
- if(_parent.bouncer._y < y && _parent.bouncer._x - _parent.bouncer._width / 2 < x && x < _parent.bouncer._x + _parent.bouncer._width / 2)
- {
- boing.start(0,1);
- if(this._currentframe == this._totalframes)
- {
- vely *= -0.85;
- }
- else
- {
- vely *= -0.9;
- }
- y = _root.bouncer._y - _root.bouncer._height / 2 - this._height / 2 - 1;
- _parent.bouncer.gotoAndPlay(2);
- }
- if(_root.end._x - _root.end._width / 2 < x && (y + this._height / 2 < _root.end._y || 0 < vely))
- {
- if(_root.end._y < y + this._height / 2)
- {
- y = _parent.end._y - this._height / 2;
- this.landed = true;
- }
- }
- if(500 < x - this._width / 2)
- {
- if(this._currentframe < this._totalframes)
- {
- _root.main.score += _root.main.regular_score;
- }
- else
- {
- _root.main.score += _root.main.fat_score;
- }
- if(_root.main.score % _root.main.extra_life_points == 0)
- {
- _root.main.lives = _root.main.lives + 1;
- }
- if(_root.main.score % _root.main.num_points_level == 0)
- {
- _root.main.difficulty = _root.main.difficulty + 1;
- if(_root.main.lowest_frames < _root.main.num_frames_pass)
- {
- _root.main.num_frames_pass -= _root.main.num_frames_away;
- }
- }
- this.removeMovieClip();
- }
- if(415 < y)
- {
- _root.main.lives--;
- _root.splat._x = x;
- _root.splat._y = 405;
- _root.splat.play();
- splat.start(0,1);
- this.removeMovieClip();
- }
- this._x = x;
- this._y = y;
- if(this.landed)
- {
- this.tomato.gotoAndStop("finished");
- }
- else if(-4 < vely && vely < 4)
- {
- this.swapDepths(2000 + Math.floor(Math.random() * 1000));
- this.tomato.gotoAndStop("peak");
- }
- else if(_parent.bouncer._x - _parent.bouncer._width / 2 < this._x && this._x < _parent.bouncer._x + _parent.bouncer._width / 2 && _parent.bouncer._y - this._y < 50)
- {
- this.tomato.gotoAndStop("landed");
- }
- else if(vely < 0)
- {
- this.tomato.gotoAndStop("going_up");
- }
- else if(0 < vely)
- {
- this.tomato.gotoAndStop("going_down");
- }
- }
- }
-